package com.guoxin.chapter2.t6;

public class Run {
	public static void main(String[] args) throws InterruptedException {
		long bein = System.currentTimeMillis();
		Task task = new Task();
		MyThread1 t1 = new MyThread1(task);
		t1.setName("T1");
		t1.start();

		MyThread2 t2 = new MyThread2(task);
		t2.setName("T2");
		t2.start();

		t1.join();
		t2.join();
		Thread.sleep(1000);
		long end = System.currentTimeMillis();
		System.out.println("耗时：" + (end - bein)/1000);
	}
}
